package day06;

import java.util.Arrays;
import java.util.Scanner;

public class txt10 {
    public static void main(String[] args) {
        int[]a=new int[6];
        Scanner sc=new Scanner(System.in);
        for(int i=0;i<=5;i++){
            a[i]=sc.nextInt();
        }


        Arrays.sort(a);
        System.out.println(Arrays.toString( a));
        int ans=0;
        for(int i=1;i<=4;i++){
            ans=ans+a[i];
        }
        System.out.println(ans/(a.length-2));
    }
}
